home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
DEPOSITO
/
REmovido
/
Esportes
/
airballs.swf
/
scripts
/
DefineSprite_22
/
frame_2
/
DoAction.as
Wrap
Text File
|
2006-07-26
|
2KB
|
74 lines
vy += gravity;
_X = _X + vx;
_Y = _Y + vy;
ball._rotation += vx * 4;
hittype = -1;
if(bot < _Y)
{
_Y = bot;
vy = (- vy) * 0.85;
vx *= 0.85;
if(Math.abs(vy) < 2)
{
if(_root.score.game)
{
_root.wrong.ballmc = this;
_root.wrong._x = _root.wrong.ballmc._x;
_root.wrong._y = _root.wrong.ballmc._y;
_root.gotoAndPlay("gameover");
vx = 0;
}
vy = - gravity;
}
else
{
_root.score.updatescore(1,6);
}
hittype = 0;
}
if(_X < left)
{
vx = (- vx) * 0.9;
_X = left;
}
else if(right < _X)
{
vx = (- vx) * 0.9;
_X = right;
}
if(hitTest(_root.alan.head))
{
point.x = _root.alan.head._x;
point.y = _root.alan.head._y;
_root.alan.localToGlobal(point);
relx = point.x - _X;
rely = point.y - _Y;
dist = relx * relx + rely * rely;
if(ball.size >= dist)
{
force = _root.alan.force;
vel = Math.sqrt(vy * vy + vx * vx);
if(10 < vel)
{
vel = 10;
}
angle = Math.atan2(rely,relx);
angle = toprot + (angle - toprot) * 0.5;
angledeg = angle * 57.29577951308232;
xfactor = Math.cos(angle);
yfactor = Math.sin(angle);
vy = (- vel) * yfactor * force / ball.mass;
vx = (- vel) * xfactor * force / ball.mass;
_Y = _Y + vy;
_X = _X + vx;
_root.score.updatescore(_root.alan.points,6);
hittype = ball._currentframe;
}
}
if(_root.score.game && -1 < hittype)
{
_root.hitsound.duplicateMovieClip("makehit",10);
_root.makehit.hit = hittype;
_root.makehit.gotoAndPlay(2);
}